//
//  UIFactory+Extension.swift
//  Microblog
//
//  Created by Roman on 17/1/6.
//  Copyright © 2017年 Roman. All rights reserved.
//

import UIKit

extension UILabel{
    convenience init(text: String,fontSize: CGFloat, textColor: UIColor){
        self.init()
        //设置属性
        self.text = text
        self.font = UIFont.systemFont(ofSize: fontSize)
        self.textColor = textColor
        self.sizeToFit()
    }
}

//UIButton 
extension UIButton {
    convenience init(backImageName: String, text: String,fontSize: CGFloat, textColor: UIColor){
        self.init()
        setBackgroundImage(UIImage(named: backImageName), for: .normal)
        //设置属性
        self.setTitle(text, for: .normal)
        self.titleLabel?.font = UIFont.systemFont(ofSize: fontSize)
        self.setTitleColor(textColor, for: .normal)
     

        self.sizeToFit()
    }
}


